package com.smedi.ismedi.progress.core.domain.service.impl;

import com.smedi.ismedi.constructionproject.api.dto.response.ProjectBasicResponse;
import com.smedi.ismedi.progress.core.application.command.MessagesSendPostCommand;
import com.smedi.ismedi.progress.core.application.service.ProgressReportApplicationService;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.Person;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.Progress;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.ProgressReport;
import com.smedi.ismedi.progress.core.domain.aggregatemodel.WeekMonthReportEidt;
import com.smedi.ismedi.progress.core.domain.dto.PersonQuery;
import com.smedi.ismedi.progress.core.domain.repository.PersonRepository;
import com.smedi.ismedi.progress.core.domain.repository.ProgressReportRepository;
import com.smedi.ismedi.progress.core.domain.service.ProgrressReportDomainService;
import com.smedi.ismedi.progress.core.port.adapter.persistence.model.ProgressReportEntity;
import com.smedi.ismedi.progress.core.port.adapter.service.TaskRemoteService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 业务服务实体类
 *
 * @author pengyan
 * @date 2022/09/20
 */
@Service
@AllArgsConstructor
public class ProgrressReportDomainServiceImpl implements ProgrressReportDomainService {

    private final ProgressReportRepository progressReportRepository;
    @Override
    public void updateProgressReportData(Progress versionManage) {
        progressReportRepository.updateProgressReportData(versionManage);
    }

    @Override
    public ProgressReport updateProgressReport(ProgressReport weekReport) {
       return progressReportRepository.updateProgressReport(weekReport);
    }

    @Override
    public ProjectBasicResponse getProject(Long projectId) {
        return progressReportRepository.getProject(projectId);
    }

    @Override
    public void updateReportDetailToProject(ProgressReport weekReport) {
        progressReportRepository.updateReportDetailToProject(weekReport);
    }

    @Override
    public WeekMonthReportEidt saveReportAndDetial(WeekMonthReportEidt weekMonthReportEidt) {
        return progressReportRepository.saveReportAndDetial(weekMonthReportEidt);
    }

    @Override
    public Integer findTimeCount(WeekMonthReportEidt weekMonthReportEidtQuery) {
        return progressReportRepository.findTimeCount(weekMonthReportEidtQuery);
    }

    @Override
    public WeekMonthReportEidt getWeekMonthReportOne(WeekMonthReportEidt weekMonthReportEidtNew) {
        return progressReportRepository.getWeekMonthReportOne(weekMonthReportEidtNew);
    }

    @Override
    public Integer findWeekReport(String firstDay, int weekType, Long id, Long projectId, int type) {
        return progressReportRepository.findWeekReport(firstDay, weekType,projectId,id,type);
    }

    @Override
    public List<ProgressReportEntity> getAllProgressReport() {
        return progressReportRepository.getAllProgressReport();
    }

    @Override
    public Integer findMonthReport(int monthType, Long projectId, Long id, int weekMonthDraftStatus) {
        return progressReportRepository.findMonthReport(monthType,projectId,id,weekMonthDraftStatus);
    }

    @Override
    public List<Map<String, Object>> milestoneAndKeyLagging7(ProgressReport weekReport) {
        return progressReportRepository.milestoneAndKeyLagging7(weekReport);
    }

    @Override
    public Integer findMonthNoReport(int monthType, Long projectId) {
        return progressReportRepository.findMonthNoReport(monthType,projectId);
    }
}
